# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-ipy
_pkgname=IPy
pkgver=1.01
pkgrel=8
pkgdesc='Class and tools for handling of IPv4 and IPv6 addresses and networks.'
arch=('any')
url='https://pypi.org/project/IPy/'
license=('BSD')
depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f0983254523025a1819d543877d9651fb6a9e39dabd3b043488495f681b02e43b544a0121658a0430a418a1c39b360a59db1699af87a75a16a2bdc29fcb2b74c')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -vDm 644 COPYING -t "$pkgdir/usr/share/licenses/$pkgname"
  install -vDm 644 {AUTHORS,ChangeLog,README.rst} \
    -t "$pkgdir/usr/share/doc/$pkgname"
}

